<template>
  <div>
    <uniPopup
      isRadius
      :show="editalert"
	  maxHeight="100vh" width="100%"
      class="editalert edit_box" :maskClick="false">
        <div class="alert-box">
          <span class="closemask">
            <img
              :src="`${constant.imgUrl}design/addfriclose.png`"
              alt=""
              @click="closeedit">
          </span>
          <div class="headecontent">
            <img
              :src="`${constant.imgUrl}publicicon/icon_saveimg.png`"
              alt=""
              class="alert_img">
            <p>保存成功</p>
          </div>
          <div class="savestatus">
            <span
              class="continue"
              @click="closeedit">继续编辑</span>
            <span
              class="backindex"
              @click="backindex">{{leftTitle}}</span>
          </div>
       </div>
    </uniPopup>
  </div>
</template>

<script>
import uniPopup from '@/components/uni-popup/uni-popup.vue'
export default {
	name: 'EditAlert',
	components: {
		uniPopup
	},
	props: {
		setUrl: {
			type: Boolean,
			default: false
		},
		routeUrl: {
			type: String,
			default: ''
		},
		leftTitle: {
			type: String,
			default: '返回首页'
		}
	},
	data() {
		return {
			editalert: false,
			constant: this.$constant,
			closestatus: ''
		}
	},
	mounted() {

	},
	methods: {
		closeedit() {
			this.editalert = false
			if (this.closestatus == 1) {
				this.$parent.showtextearea = true
			}
		},
		backindex() {
			if (!this.setUrl) {
				const owner_user_id = this.$store.getters.getUser.user_id
				const roleid = this.$store.getters.getUser.role_id
				if (roleid == 1 || roleid == 2) {
					uni.navigateTo({  // 风格/经营范围编辑
						url: `/pages/admin/index?owner_user_id=${owner_user_id}`
					})
				} else {
					uni.navigateTo({  // 风格/经营范围编辑
						url: `/pages/admin/index?owner_user_id=${owner_user_id}`
					})
				}
			} else {
				uni.navigateTo({  // 风格/经营范围编辑
					url: this.routeUrl
				})
			}
		}
	}
}
</script>

<style scoped lang="scss">
    .editalert{
        /*height: 340px;*/
        /*width: 560px;*/
        overflow-y:inherit;
        /*border-radius: 20px;*/
        /*background-color: white;*/
    }
    .headecontent{
        margin: 0 auto;
    }
    .headecontent .alert_img{
        width: 150px;
        height: 150px;
        float: left;
        margin-left: 37%;
        margin-top: -70px;
        margin-bottom: 32px;
    }
    .headecontent p{
        clear: both;
        color: #333333;
        font-size:32px;
        font-weight: bold;
        text-align: center;
    }
    .savestatus{
        width: 100%;
        height: auto;
        margin-top: 30px;
        margin-left:95px;
        clear: both;
        display: inline-block;
    }
    .savestatus span{
        float: left;
        width: 230px;
        height:80px;
        font-size:24px;
        text-align: center;
        line-height: 80px;
        border-radius: 45px;
    }
    .continue{
        background: #f5f5f5;
    }
    .backindex{
        background: #ffd11a;
        margin-left: 20px;
    }
    .alert-box {
         background-color: #fff;
          border-radius: 30px;
          height: 100%;
          padding: 20px 30px 30px;
    }
    .closemask img {
      width: 100%;
      height: 100%;
    }
</style>
